package com.zisu.springbootsource.listener;

import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.core.annotation.Order;

//实现ApplicationListener<>  并设置 我这个监听器 感兴趣的事件（ApplicationStartedEvent） 只关心事件启动事件
@Order(1)
public class FirstListener implements ApplicationListener<ApplicationStartedEvent> {
    @Override
    public void onApplicationEvent(ApplicationStartedEvent applicationStartedEvent) {
        System.out.println("hello first");
    }
}